/*
 *  Window.cpp
 *  a2
 *
 *  Created by Jeff Nicholson on 11-10-17.
 *  Copyright 2011 University of Calgary. All rights reserved.
 *
 */

#include "Window.h"

Window::Window(QWidget *parent) : QMainWindow(parent)
{
	setWindowTitle(tr("CPSC589 - 3d Modelling with Kinect"));
	
	device = &freenect.createDevice<MyFreenectDevice>(0);
	device->startVideo();
	device->startDepth();
	
	rgbView = new RgbView(device);
	renderView = new RenderView(device);
	
	mainLayout = new QHBoxLayout;
		
	mainLayout->addWidget(rgbView);
	mainLayout->addWidget(renderView);
	
	centralWidget = new QWidget;
	setCentralWidget(centralWidget);
	centralWidget->setLayout(mainLayout);
}

Window::~Window() {
	device->stopVideo();
	device->stopDepth();
}